package co.baiku.boot.youzan.push;

import co.baiku.boot.common.spring.SpringContext;
import co.baiku.boot.common.tools.StringTools;
import co.baiku.boot.config.YouzanCloudConfig;
import co.baiku.boot.config.YouzanConfig;
import co.baiku.boot.youzan.Youzan;

public interface YouzanPushHandler {

    default String clientId() {
        return SpringContext.getBean(YouzanCloudConfig.class).getClientId();
    }
    default String getKdtId() {
        return SpringContext.getBean(YouzanConfig.class).getKdtId();
    }

    String eventType();

    boolean execute(String msg);

    default boolean parseMsg() {
        return true;
    }

    default boolean checkKdtId(String kdtIdMsg){
        return StringTools.isNotBlank(kdtIdMsg) && (getKdtId().equals(kdtIdMsg));
    }
}
